<template>
  <div>
    <p>
      clicked: {{ $store.state.count }}   count is {{$store.getters.oddOrEven}}
    </p>
    <button @click="increment">+</button>
    <button @click="decrement">-</button>
    <button @click="incrementIfOdd">increment if odd</button>
    <button @click="incrementAsync">inrement async</button>
  </div>
</template>

<script>
export default {
  name: "App",
  methods: {
    increment() {
      console.log(this.$store);
      this.$store.dispatch("increment", 1);
    },
    decrement() {
      this.$store.dispatch("decrement", 1);
    },
    incrementIfOdd() {
      this.$store.dispatch("incrementIfOdd", 1);
    },
    incrementAsync() {
      this.$store.dispatch("incrementAsync", 2);
    },
  },
};
</script>

<style>
</style>